﻿@page "/system/alllog/log"
@attribute [ReuseTabsPage(Title = "日志管理")]

<Spin Spinning="Loading">
    <Table @ref="Table" AutoHeight TItem="SystemLog" @bind-PageSize="Ps" @bind-PageIndex="Pi" Total="Total" DataSource="DataSource" @bind-SelectedRows="SelectedRows" OnChange="OnChange">
        <TitleTemplate>
            <Flex Justify="FlexJustify.Start" Gap="@("10")">
                <Input Width="300" Placeholder="输入名称" @bind-Value="@Q_Name" />
                <Button OnClick="Search">搜索</Button>
                <Button OnClick="ResetQuery">重置</Button>
            </Flex>
        </TitleTemplate>
        <ColumnDefinitions Context="row">
            <PropertyColumn Align="ColumnAlign.Center" Property="c=>c.Id" Width="100" Title="ID" />
            <PropertyColumn Align="ColumnAlign.Left" Property="c=>c.Info" Title="日志信息" />
            <PropertyColumn Align="ColumnAlign.Center" Property="c=>c.LogType" Title="日志类型" Width="200" />
            <PropertyColumn Align="ColumnAlign.Center" Property="c => c.CreateTime" Title="创建时间" Width="200">
                @{
                    var formattedTime = row.CreateTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "N/A";
                }
                @formattedTime
            </PropertyColumn>
        </ColumnDefinitions>
        <PaginationTemplate>
            <Pagination Class="@(context.PaginationClass + " my-custom-pagination")"
                        Total="context.Total"
                        PageSize="context.PageSize"
                        Current="context.PageIndex"
                        ShowSizeChanger
                        ShowQuickJumper
                        ShowTotal="ShowTotal"
                        OnChange="context.HandlePageChange" />
        </PaginationTemplate>
    </Table>
</Spin>

@inject ModalService ModalService;
@inject ConfirmService ComfirmService;

